from django import forms
from .models import UserProfile


class LoginForm(forms.Form):
    username = forms.CharField(required=True, min_length=6)
    password = forms.CharField(required=True, min_length=6)


class RefisterForm(forms.Form):
    username = forms.CharField(required=True, min_length=5, error_messages={'required': '用户名必须为6位'})
    phone = forms.CharField(required=True, min_length=11, max_length=11, error_messages={'required': '手机号必须为11位'})
    password = forms.CharField(required=True, min_length=5, error_messages={'required': '密码必须为6位以上18位以下'})

class setNameForm(forms.Form):
    name = forms.CharField(required=True, min_length=1, max_length=8, error_messages={'required': '昵称不得大于8位'})
